package cn.magicduck.demo.factory.impl;

import cn.magicduck.demo.factory.ICacheAdapter;
import cn.magicduck.demo.matter.IIR;

import java.util.concurrent.TimeUnit;

/**
 * @projectName: design-pattern-demo
 * @className: IIRCacheAdapter
 * @description: 无须描述
 * @author: MagicDuck
 * @create: 2020-07-17 13:54
 **/
public class IIRCacheAdapter implements ICacheAdapter {

    private IIR iir = new IIR();

    public String get(String key) {
        return iir.get(key);
    }

    public void set(String key, String value) {
        iir.set(key, value);
    }

    public void set(String key, String value, long timeout, TimeUnit timeUnit) {
        iir.setExpire(key, value, timeout, timeUnit);
    }

    public void del(String key) {
        iir.del(key);
    }

}
